import { defineConfig, loadEnv } from "vite";
import uni from "@dcloudio/vite-plugin-uni";

// https://vitejs.dev/config/

export default defineConfig(({ mode }) => {
  const env = loadEnv(mode, './src', '')
  return {
    plugins: [uni()],
    envPrefix : env.B_ENV_PREFIX,
    envDir : './src',
    base : './',

    server : {
      hmr:true,
      host : env.B_SERVER_HOST,
      port : Number(env.B_SERVER_PORT),
      proxy : {
        '/clientApi' : env.B_PROXY_APIURL
      }
    }
  }
})